Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
Why is this input type=time invalid in some browsers with a "stepMismatch": true?

I have a very simple input type=time with a valid time value according to MDN:

:invalid { border-color: red; }
<input type="time" value="00:00:00.750" onchange="console.log(this.validity)" />

If I just run the snippet (Safari) and edit the value (Firefox 93), whatever I edit it to, the input is considered invalid afterwards, with a "stepMismatch": true validity fail reason (Safari 15, Firefox 93 and 94, MacOS 12).

What's going on here? How is step even working for this input type, and how to get rid of the invalid state?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

According to MDN, the default step attribute of an input[type=time] is equal to 60, measured in seconds.

This means that in the absence of an explicit step attribute, the time can only be changed in multiples of one minute.

The step works with the min attribute if present, or the value attribute otherwise, so setting an initial value="00:00:00.750" means that only values that are 750ms past a given minute are considered valid, and depending on the browser and how it displays the input, this may not even be possible for the user to do.

Setting step="1" will give you the option to set the seconds part of the time as you wish, and step="0.001" should also let you set milliseconds. step="any" is also an option, but at this time it's not clearly defined. I personally would take it to mean it basically disables the resolution check entirely, but browsers may disagree.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!